package net.sourceforge.jiprof.instrument.clfilter;

import com.mentorgen.tools.profile.instrument.clfilter.ClassLoaderFilter;

public class OSGiClassLoaderFilter implements ClassLoaderFilter {

	private static final String ECLIPSE_CLASSLOADER = "org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader";
	private static final String FELIX_CLASSLOADER = "org.apache.felix.framework.ModuleImpl$ModuleClassLoader";

	public boolean accept(ClassLoader loader) {
		return (loader.getClass().getName().equals(ECLIPSE_CLASSLOADER) ||
				loader.getClass().getName().equals(FELIX_CLASSLOADER));
	}

	public boolean canFilter() {
		return true;
	}

}
